From 8dce94c47a9957b47bda28243505ef3f13a509be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Fri, 28 Oct 2016 12:51:03 +0200 Subject: [PATCH] stack: Redraw last_visible_surface if child allocation changes So the widget is properly aligned. --- gtk/gtkstack.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 7b4af97914..fd23f8a403 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2239,6 +2239,13 @@ gtk_stack_allocate (GtkCssGadget *gadget, child_allocation.height = MAX (min, allocation->height); gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation); + + if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation, + &child_allocation)) + { + cairo_surface_destroy (priv->last_visible_surface); + priv->last_visible_surface = NULL; + } } child_allocation.width = allocation->width; -- 2.30.2